<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>立体呈现-transform-style</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        .father {
            width: 200px;
            height: 200px;
            margin: 200px auto;
            position: relative;

            /* 在父容器设置，将这个父容器设置为3D的，设置元素的子元素是位于 3D 空间中 */
            transform-style: preserve-3d;
            transition: all 1s;
        }
        .father:hover {
            transform: rotateY(90deg);
        }

        .son1{
            width: 200px;
            height: 200px;
            background-color: #00ff58;
            position: absolute;
            top: 0;
            left: 0;
            transform: translateZ(100px);
        }
        .son2 {
            width: 200px;
            height: 200px;
            background-color: #f21313;
            position: absolute;
            top: 0;
            left: 0;
            transform: translateZ(-100px);
        }
    </style>
</head>
<body>
<div class="father">
    <div class="son1"></div>
    <div class="son2"></div>
</div>

</body>
</html>
